#include "StdAfx.h"
#include "Encoder.h"
#include "StrUntils.h"
#include <assert.h>

CEncoder::CEncoder(LPCTSTR nameAddr)
{
    assert(nameAddr);

    std::list<CString> list;
    CStrUntils::CStringSplit(nameAddr, _T("@:"), list);
    assert(list.size() == 3);

    LPCTSTR* tmpArray[] = {&m_Name, &m_IPAddr, &m_portStr};
    std::list<CString>::iterator it = list.begin();
    int i = 0;
    for (; it != list.end(); it++){
        *tmpArray[i++] = *it;
    }
}

CEncoder::~CEncoder(void)
{
}

void CEncoder::addNoder(CEnNoder* noder){
    m_Noders.push_back(noder);
}

std::list<CEnNoder*>& CEncoder::getNoders(){
    return m_Noders;
}
